package top.kaoshanji.p3ch12a;

import java.util.ArrayList;

/**
 * 代码清单-p3ch12a-389页a：ArrayList<Number>和ArrayList<Integer>无法兼容的说明示例
 * author kaoshanji
 * ^_^
 * create time 2025/2/6 16:00
 */
public class ModifyList {

    public void modify(ArrayList<Number> list) {
        list.add(1.0f);
    }

    public void changeList() {
        ArrayList<Integer> list = new ArrayList<>();
        list.add(3);
        // modify(list); // 编译错误
        Integer value = list.get(1);
    }


}
